class Employee {  
    protected String name; // 受保护字段，允许子类访问  
    protected double salary;  

    public Employee(String name, double salary) {  
        this.name = name;  
        this.salary = salary;  
    }  

    public void work() {  
        System.out.println(name + " is working.");  
    }  

    public double getSalary() {  
        return salary;  
    }  
}  

class Manager extends Employee {  
    private double bonus;  

    public Manager(String name, double salary, double bonus) {  
        super(name, salary); // 调用父类构造函数  
        this.bonus = bonus;  
    }  

    @Override  
    public void work() {  
        System.out.println(name + " is managing employees.");  
    }  

    public double calculateTotalSalary() {  
        return salary + bonus; // 计算总薪水  
    }  
}